<template>
    <div>
        <people-head @iflog="sendlogin" :loginfo="loginfo"></people-head>
        <people-list :ifLogin="login" @loginfo="sendloginfo"></people-list>
    </div>
</template>
<script>
import PeopleHead from './components/PeopleHead.vue';
import PeopleList from './components/PeopleList.vue';
export default {
    name: 'People',
    data(){
        return{
            login:false,
            loginfo:{
				name:"请登录",
				head:"",
				headimgurl:"请登录.jpg",
				email:""
			}
        }
    },
    components: {
        PeopleHead,
        PeopleList
    },
    methods: {
        sendlogin(login) {
            this.login = login
        },
        sendloginfo(loginfo) {
            this.loginfo = loginfo
        }
    },
    mounted(){
        if(localStorage.getItem('user')){
            this.loginfo=JSON.parse(localStorage.getItem('user'))
        }
    }
}
</script>

<style scoped lang="stylus">
div
    padding-bottom 20px
</style>